package com.siwei.mes.config;

import com.siwei.mes.service.SerialService;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @Description: 编号生成工具
 * @Version: 1.0
 * @author: chenmaolin
 * @date: 2023/11/25 21:01
 */
@Component
public class UidUtils {
    @Resource
    private SerialService serialService;

    private static SerialService serial;

    /**
     * 初始化
     */
    @PostConstruct
    public void init() {
        serial = serialService;
    }

    /**
     * 生成编号保存到数据库
     *
     * @param type 类型
     * @return
     */
    public static String genNo(String type) {
        return serial.genNo(type);
    }

}
